package com.rrd.tools.lang.staticextender.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


/**
 * An annotation that can be used to override static methods. Static methods
 * annotated with this method will override a method with the same signature in
 * the first superclass of the declaring class that contains one when 
 * {@link OverrideStatics} is enabled.  For example:
 * {@code
 * 	class Base{
 * 		String callStaticMethod(){
 * 			return aStaticMethod();
 * 		}
 * 		static String aStaticMethod(){
 * 			return "Hello from Base";
 * 		}
 *  }
 *  
 *  class Subclass extends Base{
 *  	@OverridesStatic
 * 		static String aStaticMethod(){
 * 			return "Hello from Subclass";
 * 		}
 *  }
 * }
 * in the above example, once {@link OverrideStatics#enable()} is called,
 *  {@code new Subclass().callStaticMethod()} will return "Hello from Subclass"
 *   whereas {@code new Base().callStaticMethod()} will return "Hello from Base"
 *  
 * 
 * @see {@link OverrideStatics}
 * @author erachitskiy
 * 
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface OverrideStatic {

}
